In this post, I try to summarize the the construction of US Airline Flight Map. The data source comes from Bureau of Transportation Statistics. The first thing is to obtain the local airport information. For example, the GIS location, the carrier’s market share and market construction, and the distance from the near HUB. Secondly, I want to draw the flight route map.
Airport Information
To get the local airport information, we can extract from the data and use gis information to calculate distance. The whole process can be divided by three steps.
- extract all the flight routes flying into the particular airport
- use airport address to get GIS information
- organize the information and output the local airport information.
1 | import pandas as pd |
Draw the airport location map
Once we get airport infromation in different State, we can construct GIS information table and draw the map. (Currently, I just use all airport_info.csv
to construct airport_gis.csv
manually) The airport_gis.csv
includes the airport information, i.e. gis information, major carriers and market ratio for the major carriers.
1 | import folium |
Construct flight route data
1 | import sys |
Create Flight Map with plotly
Finally, with all the gis information, I can construct the flight route map. After searching for different data visualization tools, I finally decide to use plotly to do the graph. The following is the simple example for a basic route map.
1 | import plotly.plotly as py |
Resources
airport map
airportflight routes map
flight route